package com.DreamTeam.daoProxy;

import java.util.List;

import com.DreamTeam.dao.IOrderDetailDao;
import com.DreamTeam.daoImpl.OrderDetailDao;
import com.DreamTeam.daoImpl.OrderMasterDao;
import com.DreamTeam.dbc.MySqlConnection;
import com.DreamTeam.po.OrderDetail;

public class OrderDetailDaoProxy implements IOrderDetailDao {
	private MySqlConnection conn;
	private IOrderDetailDao orderDetailDao;
	public OrderDetailDaoProxy(){
		conn = new MySqlConnection();
		orderDetailDao = new OrderDetailDao(conn.getConnection());
	}
	@Override
	public boolean doAdd(OrderDetail orderDetail) {
		boolean flag = false;
		flag = orderDetailDao.doAdd(orderDetail);
		conn.closeConnection();
		return flag;
	}

	@Override
	public boolean doUpdate(OrderDetail orderDetail) {
		boolean flag = false;
		flag = orderDetailDao.doUpdate(orderDetail);
		conn.closeConnection();
		return flag;
	}

	@Override
	public boolean doDelete(OrderDetail orderDetail) {
		boolean flag = false;
		flag = orderDetailDao.doDelete(orderDetail);
		conn.closeConnection();
		return flag;
	}

	@Override
	public List<OrderDetail> queryAll() {
		List<OrderDetail> list;
		list = orderDetailDao.queryAll();
		conn.closeConnection();
		return list;
	}
	@Override
	public List<OrderDetail> queryOrderByColumnName(String columnName,String model) {
		List<OrderDetail> list;
		list = orderDetailDao.queryOrderByColumnName(columnName,model);
		conn.closeConnection();
		return list;
	}
	@Override
	public List<OrderDetail> queryOrderDetailByColumn(String keyword,
			String columnName, String orderColumn, String model) {
		List<OrderDetail> list;
		list = orderDetailDao.queryOrderDetailByColumn(keyword, columnName, orderColumn, model);
		conn.closeConnection();
		return list;
	}
	@Override
	public List<OrderDetail> queryByKeyword(String keyword) {
		List<OrderDetail> list;
		list = orderDetailDao.queryByKeyword(keyword);
		conn.closeConnection();
		return list;
	}
	
	

}
